package com.clz.workorder.fragment

import com.alibaba.android.arouter.facade.annotation.Route
import com.clz.workorder.BR
import com.clz.workorder.R
import com.clz.workorder.databinding.FragmentComplaintTakeBinding
import com.clz.workorder.viewmodel.ComplaintTakeViewModel
import com.czl.base.base.BaseFragment
import com.czl.base.config.AppConstants
import com.czl.base.config.ComplaintType
import com.czl.base.config.OrderType
import com.czl.base.event.LiveBusCenter

@Route(path = AppConstants.Router.Complaint.F_COMPLAINT_TAKE)
class ComplaintTakeFragment: BaseFragment<FragmentComplaintTakeBinding, ComplaintTakeViewModel>()  {
    override fun initContentView(): Int {
        return R.layout.fragment_complaint_take
    }

    override fun initVariableId(): Int {
        return BR.viewModel
    }
    override fun initData() {
        viewModel.tvTitle.set("受理")
        if (arguments != null){
            viewModel.no = requireArguments().getString(AppConstants.BundleKey.ORDER_NO_KEY,"")
        }
    }

    override fun initViewObservable() {
        viewModel.uc.takeSuccessEvent.observe(this,{
            LiveBusCenter.postRefreshComplaintEvent(ComplaintType.TAKE)
            back()
        })
    }
}